<!DOCTYPE html>
<html>
<head lang="en">
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit" />
    <meta name="keywords" content="有糖开放平台" />
    <meta name="description" content="有糖开放平台" />
    <link type="image/x-icon" href="images/favorite.ico" rel="shortcut icon" />
    <title>启动页 - 有糖开放平台</title>
    <link rel="stylesheet" type="text/css" media="all"  href="css/utouu.jquery.extends.pagenationstable.css" />
    <link rel="stylesheet" type="text/css" media="all"  href="css/ui-dialog.css" />
    <link rel="stylesheet" type="text/css" media="all"  href="css/style.css" />
</head>
<body>

<!-- 右侧悬浮 -->
<div class="warp_right">
    <div class="subPhone bg_icon">
        <div class="phone">400-720-9815 </div>
    </div>
    <div class="subTop bg_icon" id="gotop"></div>
</div>
<!-- 右侧悬浮END -->


<header class="warp_head bg_black"><div class="section">
    <div class="head_logo"><a href="index.html">有糖开放平台</a></div>
    <div class="head_menu">
        <ul>
            <li><a href="index.html">首页</a></li>
            <li><a href="developer.html">开发者中心</a></li>
            <li><a href="manage.html" class="active">管理中心</a></li>
        </ul>
    </div>
    <div class="head_user">
        <a href="" class="hu_register">注册</a>
        <a href="" class="hu_login">登录</a>
        <!--<a href="" class="hu_register">退出</a>
        <a href="" class="hu_user"><img src="images/user.jpg" /></a>-->
    </div>
</div></header>


<div class="layout_manage">
    <div class="section">

        <div class="warp_menu fL">
            <div class="sub_Men">
                <h3>我的应用<i></i></h3>
                <a href="manage.html">安卓应用</a>
                <a href="manage.html">IOS应用</a>
                <a href="manage.html">我的网站</a>
            </div>
            <div class="sub_Menu">
                <h3 class="sm_bg2">短信模板<i></i></h3>
                <a href="message.html">短信模板</a>
                <a href="API.html">短信API回调管理</a>
            </div>
            <div class="sub_Menu">
                <h3 class="sm_bg3">APP推送管理<i></i></h3>
                <a href="pushdata.html">推送配置</a>
            </div>
            <div class="sub_Menu sub_Menu_active">
                <h3 class="sm_bg4">启动页<i></i></h3>
                <a href="" class="active">配置启动图</a>
            </div>
        </div>

        <div class="warp_tab fR">
            <div class="tab_title">配置启动图 <div class="tab_update_date">配置时间：2016-12-02 16:59:08</div> </div>
            <div class="message_tab">
                <div id="diagram_tab">
                    <a href="diagram_add.html" class="diagram_add_btn">创建启动图</a>
                </div>
            </div>

        </div>
    </div>
</div>


<!-- 删除 -->
<div id="wmo_popDel" style="display: none;">
    <div class="wmo_popDel">
        <div>确认要删除短信模板注册验证码吗？</div>
        <div class="wmo_code">
            <p>验证码 <input type="text" placeholder="请输入下图中的文字" /></p>
            <div class="subCode">
                <img src="images/code.png" />
                <a href="">换一张</a>
            </div>
        </div>
        <div class="wmo_btn">
            <button class="btn_blue">确定</button>
            <button class="btn_grey">取消</button>
        </div>
    </div>
</div>


</body>
<script type="text/javascript" src="js/lib.js"></script>
<script type="text/javascript" src="js/jquery.SuperSlide.2.1.1.js"></script>
<script type="text/javascript" src="js/utouu.jquery.extends.pagenationstable.js"></script>
<script type="text/javascript" src="js/gptop.js"></script>
<script>
    $(document).ready(function() {
        var testJsonData = {
            data: {list: [
                {name:"汽车广告", app:"摩拜单车（iOS）",date:"2016-11-10  16:25:36",state:"0"},
                {name:"汽车广告", app:"摩拜单车（iOS）",date:"2016-11-10  16:25:36",state:"1"},
                {name:"ofo广告", app:"摩拜单车（安卓）",date:"2016-11-10  16:25:36",state:"0"},
                {name:"ofo广告", app:"摩拜单车（安卓）",date:"2016-11-10  16:25:36",state:"1"}
            ], total: 5},
            success: true,
            resultCode: "1"
        };


        /**测试代码模拟ajax接口*/
        $.ajax = function (opt) {
            console.dir(opt.data);
            opt.beforeSend();
            setTimeout(function () {
                opt.success(testJsonData);
                opt.complete();
            }, 100);
        };

        //列表
        var diagram_tab = $("#diagram_tab").utouuPagenationsTable({
            query: false/*{
                className: "clearbox",
                keepStateOnFresh: false,
                groups: [
                    {
                        isMulti:false,
                        className:"wt_select",
                        title:"应用",
                        name:"state1",
                        items:[
                            {
                                name:"s0",
                                widget:"select",        //label: 文本；button:按钮；date:日期选择器,number
                                content:"<option value='' selected>请选择</option><option value='1'>名称1</option><option value='2'>名称2</option><option value='3'>名称3</option>",
                                key:"keys",
                                value:""
                            }
                        ]
                    },{
                        isMulti: false,
                        className: "di_input",
                        name: "state1",
                        items: [
                            {
                                lazyQuery: true,
                                name: "s0",
                                widget: "text",        //文本输入框
                                key: "name",
                                default: true,
                                placeholder:"请输入名称或ID",
                                fixed: 2,
                                validate: function (value) {
                                    return true;
                                }
                            },
                            {
                                className: "wm_search",
                                name: "submit01",
                                widget: "submit",        //提交查询按钮
                                content: ""
                            }
                        ]
                    }
                ]
            }*/,
            pagenations: {
                enable: true,
                totalPage: 9,
                size: 10,
                sizePropertyName: "size",
                pagePropertyName: "page",
                startPage: 1,
                maxPageNumberCount: 5,
                url: "",
                method: "post",
                queryParameters: {},
                beforeAjaxSucccess: function (data) {
                    $(".default-query-widget-text").focus(function(){
                        $(this).parent().parent().find(".wm_search").addClass("active");
                    }).blur(function(){
                        $(this).parent().parent().find(".wm_search").removeClass("active");
                    });
                    return true;
                }
            },

            table: {
                headRow: {
                    cell: ["启动页名称", "启动页状态","配置时间","操作"]
                },
                dataRow: {
                    cell: [
                        "name",
                        {
                            data:function (data) {
                                if(data.state == 0)
                                {
                                    var a = $("<div class='d_state'>正在使用</div>");
                                }
                                else if(data.state == 1)
                                {
                                    var a = $("<div class='d_state'>暂停使用</div>");
                                }
                                return a;
                            }
                        },
                        "date",
                        {
                            data: function (data) {
                                if(data.state == 0)
                                {
                                    var b = $('<a href="javascript:void(0);" class="d_start">暂停使用</a>').click(function() {
                                        if ($(this).text() == "暂停使用") {
                                            $(this).text("立即启用");
                                            $(this).parent().parent().parent().parent().siblings().find(".d_state").text("暂停使用");
                                            $.alert("您已暂停使用此项配置","success");
                                        }
                                        else {
                                            $(this).text("暂停使用");
                                            $(this).parent().parent().parent().parent().siblings().find(".d_state").text("正在使用");
                                            $.alert("您已启用此项配置","success");
                                        }
                                    });
                                }
                                else
                                {
                                    var b = $('<a href="javascript:void(0);" class="d_start">立即启用</a>').click(function(){
                                        if($(this).text() == "暂停使用" )
                                        {
                                            $(this).text("立即启用");
                                            $(this).parent().parent().parent().parent().siblings().find(".d_state").text("暂停使用");
                                            $.alert("您已暂停使用此项配置","success");
                                        }
                                        else
                                        {
                                            $(this).text("暂停使用");
                                            $(this).parent().parent().parent().parent().siblings().find(".d_state").text("正在使用");
                                            $.alert("您已启用此项配置","success");
                                        }
                                    });
                                }

                                var c = $('<div class="wm_opreate"></div> ');
                                var del = $('<a href="javascript:void(0);" class="d_del">删除</a>').click(function () {
                                    var d = dialog({
                                        title: '删除应用',
                                        content: document.getElementById("wmo_popDel")
                                    });
                                    d.showModal();
                                });
                                var drop = $('<div class="drop_box"><i class="tipTop"></i></div>');
                                var a = $('<a href="diagram_add.html" class="link_pop">编辑</a>');
                                var o = $('<div class="td_drop"><a href="javascript:void(0);" class="a_option">管理</a></div>');

                                b.appendTo(drop);
                                del.appendTo(drop);
                                a.appendTo(c);
                                drop.appendTo(o);
                                o.appendTo(c);
                                return c;

                            }
                        }

                    ]
                },
                dataMainList: function (data) {
                    return data.data.list;
                }
            }
        });

    });
</script>
</html>